package main

import "fmt"


func CutArray(itemList []map[string]interface{}, start_index, end_index int)[]map[string]interface{}{
	if len(itemList) == 0{
		return []map[string]interface{}{}
	}
	if start_index > len(itemList)  {
		start_index = len(itemList)
	}
	if end_index > len(itemList)  {
		end_index = len(itemList)
	}
	return itemList[start_index: end_index]
}

func main(){

	var name = []map[string]interface{}{
		map[string]interface{}{"aa":1},
		map[string]interface{}{"bb":2},
		map[string]interface{}{"cc":3},
		map[string]interface{}{"dd":4},
		map[string]interface{}{"ee":5},
	}

	fmt.Println(name[2:4])
	fmt.Println(CutArray(name, 2 , 10))

}
